package ProjectManagement;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebServlet(name = "coursestudent",value = "/coursestudent")
public class coursestudent extends HttpServlet {

    private static final long serialVersionUID = 1L;

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        this.doPost(request, response);
    }

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        HttpSession session=request.getSession();
        String courseid = (String) request.getParameter("courseid");
        session.setAttribute("courseid",courseid);

        coursestudent(request,response);
    }

    public void coursestudent(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
        String mainPage = "coursestudent.jsp";
        request.setAttribute("mainPage", mainPage);
        RequestDispatcher dispatcher = request.getRequestDispatcher("/ProjectManagement/main.jsp");
        dispatcher.forward(request, response);
    }
}